#include "RootObject.h"

void RRootObject::RemoveChildFromChildren(RObject *Child)
{
    std::lock_guard<std::mutex> Lock(ChildrenLock);
    Super::RemoveChildFromChildren(Child);
}

void RRootObject::AddChildToChildren(RObject *Child)
{
    std::lock_guard<std::mutex> Lock(ChildrenLock);
    Super::AddChildToChildren(Child);
}

void RRootObject::MakeSureChildNameUnique(RObject *Child)
{
    std::lock_guard<std::mutex> Lock(ChildrenLock);
    Super::MakeSureChildNameUnique(Child);
}

RObject *RRootObject::FindChild(const CString &InChildName)
{
    std::lock_guard<std::mutex> Lock(ChildrenLock);
    
    for(auto& Child : GetChildren())
    {
        if(Child->GetNodeName()==InChildName)
        {
            return Child;
        }
    }
    return nullptr;
}
